const md5 = require('md5');
module.exports = class signUtil {
  /**
   * 获取签名
   * @param data
   * @returns {*}
   */
  static getSign(data, notSign = 'sign') {
    let url = '';
    Object.keys(data).sort().forEach((key) => {
      if (key + '' !== notSign + '') {
        url += `${key}=${data[key]}&`;
      }
    });
    url = url.substr(0, url.length - 1);
    return md5(url).toUpperCase();
  }
};
